package cn.tedu.sp04.order.feign;

import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFB implements UserFeignClient{
    @Override
    public JsonResult<User> getUser(Integer userId) {
        //模拟使用过缓存
        if(Math.random()<0.5){
            User user = new User(1,"张三","密码保密");

            return JsonResult.ok(user);
        }

        return JsonResult.err().msg("订单用户信息获取失败");
    }

    @Override
    public JsonResult addScore(Integer userId, Integer score) {


        return JsonResult.err().msg(" 用户积分增加失败");
    }
}
